package echat.future.cn.echat.my.adapter;

import android.graphics.Color;
import android.support.annotation.Nullable;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import echat.future.cn.echat.R;
import echat.future.cn.echat.my.bean.RechargeBean;

/**
 * 充值适配器
 */
public class RechargeAdapter extends BaseQuickAdapter<RechargeBean,BaseViewHolder> {

    public RechargeAdapter(@Nullable List<RechargeBean> data) {
        super(R.layout.item_recharge,data);
    }

    @Override
    protected void convert(BaseViewHolder helper, RechargeBean item) {
        helper.setText(R.id.number,item.getNumber())
                .setText(R.id.value,item.getValue());
        if(item.isCheck()){
            helper.setBackgroundRes(R.id.bg,R.drawable.bg_item_recharge)
                    .setGone(R.id.arrow, true)
                    .setTextColor(R.id.number, Color.WHITE)
                    .setTextColor(R.id.value,Color.WHITE);
        }else{
            helper.setBackgroundRes(R.id.bg,R.drawable.bg_me_bootm_jump)
                    .setGone(R.id.arrow, false)
                    .setTextColor(R.id.number,mContext.getResources().getColor(R.color.color_F8C56E))
                    .setTextColor(R.id.value,mContext.getResources().getColor(R.color.color_F8C56E));
        }
    }
}
